﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using com.hyrentals.webcommon.filter;
using com.hyrentals.logic;
using com.hyrentals.data;
using com.hyrentals.webcommon.api;

namespace com.hyrentals.webportal.Controllers
{
    //[OnError(ComponentType.Search)]
    public class SearchController : BaseController
    {
        private RVLogic _RVLogic = new RVLogic();

        [HttpGet]
        public ActionResult Index()
        {
             IEnumerable<RV> RVs = _RVLogic.GetAllRV(1, 10);

             return View(RVs);
        }

        [HttpGet]
        public ActionResult Detail(string id)
        {
            RV rv = _RVLogic.GetRVById(id);

            if (rv == null)
            {
                return RedirectToAction("NotFound", "Error");
            }
            ViewBag.UserId = User.Identity.Name;
            return View(rv);
        }
    }
}